"""
@author RansySun
@create 2019-12-03-21:30
"""
# 右键执行该文件，下面环境合理
from celery_task1.tasks import jump

# 添加延迟任务
# args是jump任务需要的参数，没有就设置为空()
# eta是该任务执行的UTC格式的时间
from datetime import datetime, timedelta
def eta_second(second):
    ctime = datetime.now()
    utc_ctime = datetime.utcfromtimestamp(ctime.timestamp())
    time_delay = timedelta(seconds=second)
    return utc_ctime + time_delay
jump.apply_async(args=(200, 50), eta=eta_second(30))
